import { View } from "@tarojs/components";
import Taro from "@tarojs/taro";
import React from "react";

type TPolicieRegulaItemProps = {
  info: {
    title: string;
    area: string;
    releaseDate: string;
    type: string;
  };
};

const PolicieRegulaItem: React.FC<TPolicieRegulaItemProps> = ({ info }) => {
  return (
    <View
      className="w-full p-4 mb-2 bg-white rounded-lg shadow-sm"
      onClick={() =>
        Taro.navigateTo({
          url: "/pages/PolicieRegula/components/RegulationsInterpreteDetail/index",
        })
      }
    >
      <View className="mb-2">{info?.title}</View>
      <View className="flex flex-row items-center justify-between w-full flex-nowrap">
        <View className="text-xs text-slate-500">适用地区：{info.area}</View>
        <View className="text-xs text-slate-500">
          发布时间：{info.releaseDate}
        </View>
      </View>
      <View className="text-xs text-slate-500">适用类型：{info.type}</View>
    </View>
  );
};

export default PolicieRegulaItem;
